package ComparableTest;

import java.util.Date;

//public class Product implements Comparable {//类内比较   
class Product {

    private String name;
    private Date date;
    private int price;

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }
//用于类内比较
//  @Override//覆写compareTo(Object o)方法   
//  public int compareTo(Product o) {   
//      return -this.date.compareTo(o.date);   
//  }   
}